home *** CD-ROM | disk | FTP | other *** search
/ DarkBasic Professional / DarkBasicPro.iso / data1.cab / Lang_Files_(English) / Projects / Planet_Potter / progress / Planet Potter 2.dba < prev    next >
Encoding:
Text File  |  2004-09-22  |  1.9 KB  |  95 lines

  1. Rem Project: Planet Potter
  2. Rem Created: 25/07/2002 15:38:30
  3.  
  4. rem Initialise
  5. sync on : sync rate 60
  6. set text font "Arial" : set text size 20
  7. set text to bold : set text transparent
  8.  
  9. rem Load environment
  10. load object "media\moonlit\ml.x",100
  11. scale object 100,20,20,20
  12. set object cull 100,0
  13. set object light 100,0
  14. set object texture 100,2,1
  15.  
  16. rem Load nine planets
  17. for p=1 to 9
  18.  load object "media\planet\planet.x",p
  19.  position object p,(p-3)*350,0,500
  20.  hide object p
  21. next p
  22.  
  23. rem Load player sounds
  24. load sound "media\sounds\shoot.wav",1
  25.  
  26. rem Load game sounds
  27. load sound "media\sounds\appear.wav",11
  28. for s=12 to 19 : clone sound s,11 : next s
  29. load sound "media\sounds\explode.wav",21
  30. for s=22 to 29 : clone sound s,21 : next s
  31.  
  32. rem Setup camera and light
  33. set camera range 0.1,3000
  34. set point light 0,-100,100,-200
  35.  
  36. rem Starting rate
  37. prate=200
  38.  
  39. rem Game loop
  40. do
  41.  
  42. rem Control player cursor and shot
  43. if mouseclick()=1 and guncool=-1
  44.  play sound 1 : guncool=3
  45. endif
  46. if guncool=0 and mouseclick()=0 then guncool=-1
  47. if guncool>0 then dec guncool
  48.  
  49. rem Control planets
  50. gosub _newplanets
  51. gosub _moveplanets
  52.  
  53. rem Rotate sky backdrop
  54. yrotate object 100,wrapvalue(object angle y(100)+0.1)
  55.  
  56. rem Stats
  57. inc points
  58. prompt$="SCORE: "+str$(points)
  59. center text screen width()-text width(prompt$),screen height()-40,prompt$
  60.  
  61. rem Update screen
  62. sync
  63.  
  64. rem End loop
  65. loop
  66. end
  67.  
  68. _newplanets:
  69.  
  70. if pmaker>0 then dec pmaker
  71. if pmaker=0
  72.  p=1 : while object visible(p)=1 and p<9 : inc p : endwhile
  73.  x=rnd(3000)-1500
  74.  y=rnd(2000)-1000
  75.  position object p,x,y,1000
  76.  play sound 10+p
  77.  show object p
  78.  pmaker=prate+rnd(prate/2)
  79.  if prate>50 then dec prate,5
  80. endif
  81.  
  82. return
  83.  
  84. _moveplanets:
  85.  
  86. rem Move all planets
  87. for p=1 to 9
  88.  position object p,object position x(p)/1.007,object position y(p)/1.007,object position z(p)-5
  89.  yrotate object p,wrapvalue(object angle y(p)+1)
  90.  if object position z(p)<-600 then hide object p
  91. next p
  92.  
  93. return
  94.  
  95.